import request from '@/utils/request'

export function chatStream(messages) {
  const data = {
    messages:messages,
    model:"deepseek-chat",
    stream:true
  }
  return fetch('/deepseek/chat/completions', {
		method: 'post',
		body:JSON.stringify(data),
		responseType: 'srteam',
		headers: {
			'Content-Type': 'application/json',
      'Authorization':'Bearer sk-df0831cae1e446e3a1b20e32d6e597f9'
		}
	})
}

// 方法
export function chatJava(messages) {
  const data = messages
  return request({
    url: '/system/user/problem',
    method: 'post',
    data: data
  })
}

// 方法
export function chatLocal(messages) {
  const data = {
    messages:messages,
    model:"deepseek-r1:14b",
    stream:true
  }

  return fetch('/mac/v1/chat/completions', {
		method: 'post',
		body:JSON.stringify(data),
		responseType: 'srteam',
		headers: {
			'Content-Type': 'application/json',
      'Authorization':'ollama'
		}
	})

}
